import React from "react"
import { Navigate } from "react-router-dom"

import Login from "../pages/Login"
import NotFound from "../pages/NotFound"
const Home = React.lazy(() => import("../pages/Home"))
const Dict = React.lazy(() => import("../pages/system/Dict"))
const Menu = React.lazy(() => import("../pages/system/Menu"))
const Role = React.lazy(() => import("../pages/system/Role"))
const User = React.lazy(()=>import("../pages/system/User"))
const Profile = React.lazy(() => import("../pages/profile/Profile"))
const NavPage = React.lazy(() => import("../pages/nav/index"))
export const routes = [
    {
        path: '/',
        element: <Navigate to='/login' />
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/home',
        element: <NavPage />,
        children: [
            {
                index: true,
                element: <Home />,
            }
        ]
    },
    {
        path: '/system',
        element: <NavPage />,
        children: [
            {
                path: 'dict',
                element: <Dict />
            },
            {
                path: 'menu',
                element: <Menu />
            },
            {
                path: 'role',
                element: <Role />
            },
            {
                path: 'user',
                element: <User />
            },
        ]
    },
    {
        path: '/profile',
        element: <NavPage />,
        children: [
            {
                index:true,
                element: <Profile />,
            }
        ]
    },
    {
        path: '*',
        element: <NotFound />
    }
]

export default {}